

export const AutoQueryVModelCode =
`
import { JsonProperty } from 'json-mapper-object';
/** 示例代码*/
export class ResponseVModelNameDataEntity{
    @JsonProperty('id')
    id = void 0

}
`


export const CUSTOM_COLUMNS_RENDER_CODE =
`
/** 自定义列渲染函数，可自行填入渲染内容*/
function render(text, record, index){
    return <div></div>
}
`
/** 搜索组件搜索函数代码 */
export const QUERY_SEARCH_CODE =
`
function onSearch(value,view){
    that.handleSearch(value) 
}
`
/** 搜索组件重置函数代码 */
export const QUERY_RESAT_CODE = `
function onReset(value,view){
    that.handleReset(value) 
}
`
/** 表格搜索函数 */
export const TABLE_SEARCH_CODE =
`
/**请勿修改函数结构,直接在函数内部输入代码
*/
function handleSearch(value){
    let val = value;
    this.queryPrams = { ...this.queryPrams, ...val };
    this.tableRef.methods.onSearch()
}
`
/** 表格重置数据函数  */
export const TABLE_RESET_CODE =
`
/**请勿修改函数结构,直接在函数内部输入代码
*/
function handleReset(value){
    this.handleSearch(value);
}
`
export const TABLE_MAPPING_ENTITY_CODE = `
function mappingEntity(that, res){
    that.result = res['data']
}
`
export const TABLE_SEARCH_PARAMS_CODE =
`
/**请勿修改函数结构,直接在函数内部输入代码
*/
function params(pageIndex,pageSize){                          
    return { size: pageSize, current: pageIndex, ...this.parames }
}
`
export const TABLE_TRANFORM_CODE =
`
/**请勿修改函数结构,直接在函数内部输入代码
*/
function transform(value){
    if (value && !value.isPending&& value.value) {
        const { result = [], current, pageSize, total } = value.value.result;
        return {
            data:result.map((item, index) => {
                return item;
            }),
            total:total,
        };
    }
    return {
        total: 0,
        data:[],
    };
}
`
export const TABLE_TOKEN_CODE =
`
/**请勿修改函数结构,直接在函数内部输入代码
 * 示例:
 function token(){
    return process.env.environment==='dev'?'SESSION=3aaa0e0f-e799-4ec6-8612-da5593f7414d':DevToken
}
*/
function token(){
    // return string 返回字符串
    return process.env.environment==='dev'?'SESSION=3aaa0e0f-e799-4ec6-8612-da5593f7414d':DevToken
}
`
/**
 * 列表模板组件代码
 */
export const PageListComponentCode =
`
    import React,{ Component } from 'react'
    import { observer, bind } from 'legions/store-react';
    import { Button,Row,Col,Icon,message,Modal } from 'antd'
    import { LegionsProTable, LegionsProPageContainer,LegionsModels,LegionsProConditions } from 'legions-pro-design';
    import { InstanceProTable } from 'legions-pro-design/es/LegionsProTable/interface';
    import {  InstanceQueryConditions } from 'legions-pro-design/es/LegionsProConditions/interface';
    import {submittingAutoMessage,loadProgress} from 'legions-lunar/mobx-decorator'
    import {download} from 'legions-utils-tool/download'
    import { observablePromise,observableViewModel } from 'legions/store-utils'
    import { observable,action,computed } from 'mobx';
    import { get, post } from 'legions/request';
    import { HttpConfig } from 'common/constants/httpConfig';
    import {typeContainerEntity} from 'common/models/containerEntity';
    interface IContainerEntity{}
    interface IProps{
    }
    class ViewModel {
    }
    @observer
    export default class PageListComponentCode extends LegionsProTable.ProTableBaseClass<IProps,{}>{
        queryRef: InstanceQueryConditions = null;
        viewModel = observableViewModel<ViewModel>(new ViewModel());
        /** 搜索条件 */
        parames:Object = {};
        constructor(props: IProps) {
            super(props)
        }
        render(){
            return null
        }
    }
`;



